//
//  DYPrintTaskCmd.h
//  DYPrintSDK
//
//  Created by mr.ye on 2023/11/22.
//  任务回调解析

#import <Foundation/Foundation.h>
#import <DYPrintSDK/DYPrintCmd.h>
NS_ASSUME_NONNULL_BEGIN

typedef NSObject * _Nullable(^TaskParseCall)(NSData *data);

typedef void(^TaskCompelete)(id   _Nullable obj,NSUInteger code);


@interface DYPrintTaskCmd : NSObject

@property (nonatomic , strong) NSData *data;

//解析回调
@property (nullable , nonatomic ,copy) TaskCompelete compelete;

//解析回调
@property (nullable, nonatomic , copy) TaskParseCall parse;


/// 状态查询
/// - Parameters:
///   - compelete: 回调
///   - data:状态质量
+ (instancetype)getStateTaskCompelete:(TaskCompelete)compelete;

/// 基础信息查询
/// - Parameters:
///   - compelete: 回调
+(instancetype)getBaseInfoCmd:(TaskCompelete)compelete;

//查询关机时间
/// - Parameters:
///   - compelete: 回调
+(instancetype)getShutTimeCmd:(TaskCompelete)compelete;

//查询型号
/// - Parameters:
///   - compelete: 回调
+(instancetype)getModeCmd:(TaskCompelete)compelete;

//查询浓度
/// - Parameters:
///   - compelete: 回调
+(instancetype)getPrintColorCmd:(TaskCompelete)compelete;

//设置关机时间
/// - Parameters:
///   - time 分钟
///    - compelete: 回调
+ (instancetype)setShutTimeCmd:(NSUInteger)time compelete:(TaskCompelete)compelete;


//设置颜色
/// - Parameters:
///   - color 颜色 0 到 2，具体问打印机固件
///    - compelete: 回调
+ (instancetype)setColorCmd:(NSUInteger)color compelete:(TaskCompelete)compelete;


//设置纸张类型
+ (instancetype)setPaperTypeCmd:(DYPrintPaperType)paper compelete:(TaskCompelete)compelete;

//退纸张
+ (instancetype)returePaperCompelete:(TaskCompelete)compelete;

//进纸张
+ (instancetype)enterPaperCompelete:(TaskCompelete)compelete;




//设置定位纸张类型
+ (instancetype)setPaperPostionCmd:(DYPrintPaperType)paper compelete:(TaskCompelete)compelete;


//写入更新固件数据
+ (instancetype)sendUpdateDataTask:(NSData *)data loc:(NSUInteger)loc compelete:(TaskCompelete)compelete;

/// 普通指令，没有解析
/// - Parameters:
///   - compelete: 回调
+ (instancetype)commentCmd:(TaskCompelete)compelete data:(NSData*)data;


@end

NS_ASSUME_NONNULL_END
